<!-- ONE STEP TO INSTALL PANORAMIC IMAGE VIEWER:

  1.  Copy the coding into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document  -->

<HEAD>
</HEAD>

<BODY>

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original:  Martin Krolik -->
<!-- Web Site:  http://krolik.net/PIV.jsp  -->
<SCRIPT  type="text/javascript">
//                  360 Degree Panorama Image Viewer
// **************************************************************************
// 			Written by Martin Krolik
// 			http://krolik.net
// 			martin@krolik.net
// **************************************************************************
// Original Cross Browser (NS4+,NS6+/Mozilla1+,IE4+,Safari1+) DHTML 360 Degree Panormic Image Javascript Viewer
// Version 3.2 
// Works by putting two of the same image adjacent.  A viewport scrolls throw the images
// as the images moves to compensate.
// vars below
var mytimer,xdist,ydist,xoffset,yoffset,xviewport,yviewport,defaulttravel,defaulttimeout,borderheight,borderwidth,bwidth,bheight,myobject,outerimgdiv,mypframe,myloadingdiv,myimage,mysecondimage,initialized,loaded,xoffsetwithinpic,yoffsetwithinpic,origimagewidth,origimageheight,maxtravel;
 
var imgNW,imgN,imgNE,imgW,imgE,imgSW,imgS,imgSE; 
 
// vars above
// ----------------------  Parameters below --------------------------------//
xoffset = 0;   
yoffset = 0;
xoffsetwithinpic = 0; // messes everything up... see note in code - not implemented 
yoffsetwithinpic = 0; // messes everything up... see note in code - not implemented
xviewport = 600;   // size of view window ... must be less than size of image
yviewport = 400;
defaulttravel = 3; // how many pixels at a time we move .... choppy'ness VS. slowness
defaulttimeout = 20; // how many milliseconds between moves
maxtravel = 8; // max number of pixels to move with mouse move event
borderheight = 25; // actually should be derived from NORTH or SOUTH BORDER image, but isn't
borderwidth = 25; // actualy should be derived from EAST or WEST BORDER image, but isn't
var dblZoom = 1.0;
// ----------------------  Parameters above --------------------------------//
// init code below - no modifications required
initialized = false;
loaded = false;
var pOldOnLoadPIV = null;
var pOldOnResizePIV = null;
if (window.onload != null) {
  pOldOnLoadPIV = window.onload;
}
if (window.onresize != null) {
  pOldOnResizePIV = window.onresize;
}

var xVersion='3.10',xOp7=false,xOp5or6=false,xIE4Up=false,xNN4=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
  xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
  if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if(document.layers) xNN4=true;
else {xIE4Up=document.all && xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;}

// Appearance:
function xShow(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='inherit';
  else if(xDef(e.visibility)) e.visibility='show';
}
function xHide(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='hidden';
  else if(xDef(e.visibility)) e.visibility='hide';
}
function xZIndex(e,uZ) {
  if(!(e=xGetElementById(e))) return 0;
  if(e.style && xDef(e.style.zIndex)) {
    if(arguments.length>1) e.style.zIndex=uZ;
    else uZ=e.style.zIndex;
  }
  else if(xDef(e.zIndex)) {
    if(arguments.length>1) e.zIndex=uZ;
    else uZ=e.zIndex;
  }
  return uZ;
}
function xColor(e,sColor) {
  if(!(e=xGetElementById(e))) return "";
  var c="";
  if(e.style && xDef(e.style.color)) {
    if(arguments.length>1) e.style.color=sColor;
    c=e.style.color;
  }
  return c;
}
function xBackground(e,sColor,sImage) {
  if(!(e=xGetElementById(e))) return "";
  var bg="";
  if(e.style) {
    if(arguments.length>1) e.style.backgroundColor=sColor;
    if(arguments.length==3) e.style.backgroundImage=(sImage && sImage!="")? "url("+sImage+")" : null;
    bg=e.style.backgroundColor;
  }
  else if(xDef(e.bgColor)) {
    if(arguments.length>1) e.bgColor=sColor;
    bg=e.bgColor;
    if(arguments.length==3) e.background.src=sImage;
  }
  return bg;
}

// Position:
function xMoveTo(e,iX,iY) {
  xLeft(e,iX);
  xTop(e,iY);
}
function xLeft(e,iX) {
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if (css && xDef(e.style.left) && typeof(e.style.left)=="string") {
    if(arguments.length>1) e.style.left=iX+"px";
    else {
      iX=parseInt(e.style.left);
      if(isNaN(iX)) iX=0;
    }
  }
  else if(css && xDef(e.style.pixelLeft)) {
    if(arguments.length>1) e.style.pixelLeft=iX;
    else iX=e.style.pixelLeft;
  }
  else if(xDef(e.left)) {
    if(arguments.length>1) e.left=iX;
    else iX=e.left;
  }
  return iX;
}
function xTop(e,iY) {
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if(css && xDef(e.style.top) && typeof(e.style.top)=="string") {
    if(arguments.length>1) e.style.top=iY+"px";
    else {
      iY=parseInt(e.style.top);
      if(isNaN(iY)) iY=0;
    }
  }
  else if(css && xDef(e.style.pixelTop)) {
    if(arguments.length>1) e.style.pixelTop=iY;
    else iY=e.style.pixelTop;
  }
  else if(xDef(e.top)) {
    if(arguments.length>1) e.top=iY;
    else iY=e.top;
  }
  return iY;
}
function xPageX(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.pageX)) return e.pageX;
  var x = 0;
  while (e) {
    if (xDef(e.offsetLeft)) x += e.offsetLeft;
    e = xParent(e);
  }
  return x;
}
function xPageY(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.pageY)) return e.pageY;
  var y = 0;
  while (e) {
    if (xDef(e.offsetTop)) y += e.offsetTop;
    e = xParent(e);
  }
  return y;
}
function xSlideTo(e,x,y,uTime) {
  if (!(e=xGetElementById(e))) return;
  if (!e.timeout) e.timeout = 25;
  e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false;
  e.yA = e.yTarget - xTop(e); e.xA = e.xTarget - xLeft(e); // A = distance
  e.B = Math.PI / (2 * e.slideTime); // B = period
  e.yD = xTop(e); e.xD = xLeft(e); // D = initial position
  var d = new Date(); e.C = d.getTime();
  if (!e.moving) xSlide(e);
}
function xSlide(e) {
  if (!(e=xGetElementById(e))) return;
  var now, s, t, newY, newX;
  now = new Date();
  t = now.getTime() - e.C;
  if (e.stop) { e.moving = false; }
  else if (t < e.slideTime) {
    setTimeout("xSlide('"+e.id+"')", e.timeout);
    s = Math.sin(e.B * t);
    newX = Math.round(e.xA * s + e.xD);
    newY = Math.round(e.yA * s + e.yD);
    xMoveTo(e, newX, newY);
    e.moving = true;
  }  
  else {
    xMoveTo(e, e.xTarget, e.yTarget);
    e.moving = false;
  }  
}

// Size:
function xResizeTo(e,uW,uH) {
  xWidth(e,uW);
  xHeight(e,uH);
}
function xWidth(e,uW) {
  if(!(e=xGetElementById(e)) || (uW && uW<0)) return 0;
  uW=Math.round(uW);
  var css=xDef(e.style);
  if(css && xDef(e.style.width,e.offsetWidth) && typeof(e.style.width)=="string") {
    if(arguments.length>1) xSetCW(e, uW);
    uW=e.offsetWidth;
  }
  else if(css && xDef(e.style.pixelWidth)) {
    if(arguments.length>1) e.style.pixelWidth=uW;
    uW=e.style.pixelWidth;
  }
  else if(xDef(e.clip) && xDef(e.clip.right)) {
    if(arguments.length>1) e.clip.right=uW;
    uW=e.clip.right;
  }
  else if(e.width)
  {
    uW = e.width
  }
  return uW;
}
function xHeight(e,uH) {
  if(!(e=xGetElementById(e)) || (uH && uH<0)) return 0;
  uH=Math.round(uH);
  var css=xDef(e.style);
  if(css && xDef(e.style.height,e.offsetHeight) && typeof(e.style.height)=="string") {
    if(arguments.length>1) xSetCH(e, uH);
    uH=e.offsetHeight;
  }
  else if(css && xDef(e.style.pixelHeight)) {
    if(arguments.length>1) e.style.pixelHeight=uH;
    uH=e.style.pixelHeight;
  }
  else if(xDef(e.clip) && xDef(e.clip.bottom)) {
    if(arguments.length>1) e.clip.bottom=uH;
    uH=e.clip.bottom;
  }
  else if(e.height)
  {
    uH = e.height
  }
  return uH;
}
// thank moz for the next 2000 bytes
function xGetCS(ele,sP){return parseInt(document.defaultView.getComputedStyle(ele,"").getPropertyValue(sP));}
function xSetCW(ele,uW){
  if(uW<0) return;
  var pl=0,pr=0,bl=0,br=0;
  if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
    pl=xGetCS(ele,"padding-left");
    pr=xGetCS(ele,"padding-right");
    bl=xGetCS(ele,"border-left-width");
    br=xGetCS(ele,"border-right-width");
  }
  else if(xDef(ele.currentStyle,document.compatMode)){
    if(document.compatMode=="CSS1Compat"){
      pl=parseInt(ele.currentStyle.paddingLeft);
      pr=parseInt(ele.currentStyle.paddingRight);
      bl=parseInt(ele.currentStyle.borderLeftWidth);
      br=parseInt(ele.currentStyle.borderRightWidth);
    }
  }
  else if(xDef(ele.offsetWidth,ele.style.width)){
    ele.style.width=uW+"px";
    pl=ele.offsetWidth-uW;
  }
  if(isNaN(pl)) pl=0; if(isNaN(pr)) pr=0; if(isNaN(bl)) bl=0; if(isNaN(br)) br=0;
  var cssW=uW-(pl+pr+bl+br);
  if(isNaN(cssW)||cssW<0) return;
  else ele.style.width=cssW+"px";
}
function xSetCH(ele,uH){
  if(uH<0) return;
  var pt=0,pb=0,bt=0,bb=0;
  if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
    pt=xGetCS(ele,"padding-top");
    pb=xGetCS(ele,"padding-bottom");
    bt=xGetCS(ele,"border-top-width");
    bb=xGetCS(ele,"border-bottom-width");
  }
  else if(xDef(ele.currentStyle,document.compatMode)){
    if(document.compatMode=="CSS1Compat"){
      pt=parseInt(ele.currentStyle.paddingTop);
      pb=parseInt(ele.currentStyle.paddingBottom);
      bt=parseInt(ele.currentStyle.borderTopWidth);
      bb=parseInt(ele.currentStyle.borderBottomWidth);
    }
  }
  else if(xDef(ele.offsetHeight,ele.style.height)){
    ele.style.height=uH+"px";
    pt=ele.offsetHeight-uH;
  }
  if(isNaN(pt)) pt=0; if(isNaN(pb)) pb=0; if(isNaN(bt)) bt=0; if(isNaN(bb)) bb=0;
  var cssH=uH-(pt+pb+bt+bb);
  if(isNaN(cssH)||cssH<0) return;
  else ele.style.height=cssH+"px";
}
function xClip(e,iTop,iRight,iBottom,iLeft) {
  if(!(e=xGetElementById(e))) return;
  if (iTop==null) iTop = xClipValues(e,'t');
  if (iRight==null) iRight = xClipValues(e,'r');
  if (iBottom==null) iBottom = xClipValues(e,'b');
  if (iLeft==null) iLeft = xClipValues(e,'l');

  if(e.style) {
    if (arguments.length == 5) e.style.clip="rect("+iTop+"px "+iRight+"px "+iBottom+"px "+iLeft+"px)";
    else e.style.clip="rect(0 "+parseInt(e.style.width)+"px "+parseInt(e.style.height)+"px 0)";
  }
  else if(e.clip) {
    if (arguments.length == 5) { e.clip.top=iTop; e.clip.right=iRight; e.clip.bottom=iBottom; e.clip.left=iLeft; }
    else { e.clip.top=0; e.clip.right=xWidth(e); e.clip.bottom=xHeight(e); e.clip.left=0; }
  }
}

// Event:
function xAddEventListener(e,eventType,eventListener,useCapture) {
  if(!(e=xGetElementById(e))) return;
  eventType=eventType.toLowerCase();
  if((!xIE4Up && !xOp7) && e==window) {
    if(eventType=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eventListener; xResizeEvent(); return; }
    if(eventType=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eventListener; xScrollEvent(); return; }
  }
  var eh="e.on"+eventType+"=eventListener";
  if(e.addEventListener) e.addEventListener(eventType,eventListener,useCapture);
  else if(e.attachEvent) e.attachEvent("on"+eventType,eventListener);
  else if(e.captureEvents) {
    if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.captureEvents(eval("Event."+eventType.toUpperCase())); }
    eval(eh);
  }
  else eval(eh);
}
function xRemoveEventListener(e,eventType,eventListener,useCapture) {
  if(!(e=xGetElementById(e))) return;
  eventType=eventType.toLowerCase();
  if((!xIE4Up && !xOp7) && e==window) {
    if(eventType=='resize') { window.xREL=null; return; }
    if(eventType=='scroll') { window.xSEL=null; return; }
  }
  var eh="e.on"+eventType+"=null";
  if(e.removeEventListener) e.removeEventListener(eventType,eventListener,useCapture);
  else if(e.detachEvent) e.detachEvent("on"+eventType,eventListener);
  else if(e.releaseEvents) {
    if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.releaseEvents(eval("Event."+eventType.toUpperCase())); }
    eval(eh);
  }
  else eval(eh);
}
function xEvent(evt) { // cross-browser event object prototype
  this.type = "";
  this.target = null;
  this.pageX = 0;
  this.pageY = 0;
  this.offsetX = 0;
  this.offsetY = 0;
  this.keyCode = 0;
  var e = evt ? evt : window.event;
  if(!e) return;
  // type
  if(e.type) this.type = e.type;
  // target
  if(xNN4) this.target = xLayerFromPoint(e.pageX, e.pageY);
  if(!(this.target))
    {
    if(e.target) this.target = e.target;
    else if(e.srcElement) this.target = e.srcElement;
    }
  //if ((! this.keyCode) & (e.keyCode)) { this.keyCode = e.keyCode; }
  // pageX, pageY
  if(xOp5or6) { this.pageX = e.clientX; this.pageY = e.clientY; }
  else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; }
  else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }
  // offsetX, offsetY
  if(xDef(e.layerX,e.layerY)) { this.offsetX = e.layerX; this.offsetY = e.layerY; }
  else if(xDef(e.offsetX,e.offsetY)) { this.offsetX = e.offsetX; this.offsetY = e.offsetY; }
  else { this.offsetX = this.pageX - xPageX(this.target); this.offsetY = this.pageY - xPageY(this.target); }
  // keycode
  if (xDef(e.keyCode)) { this.keyCode = e.keyCode; }
  else if (xDef(e.which)) { this.keyCode = e.which; }
}
function xResizeEvent() { // window resize event simulation
  if (window.xREL) setTimeout("xResizeEvent()", 250);
  var cw = xClientWidth(), ch = xClientHeight();
  if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }
}
function xScrollEvent() { // window scroll event simulation
  if (window.xSEL) setTimeout("xScrollEvent()", 250);
  var sl = xScrollLeft(), st = xScrollTop();
  if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }
}

// Object:
function xGetElementById(e, src) {
  if(typeof(e)!="string") return e;
  if(document.getElementById) e=document.getElementById(e);
  else if(document.all) e=document.all[e];
  else if(document.layers) 
    {
      e = xLayer(e);
    }
  else 
    {
      e=null;
    }
  return e;
}
function xLayer(id,root) { // only for nn4
  var i,j,layer,formiterator,formelement,found=null;
  if (!root) root=window;
  var e=root.document.images[id.toString()];
  if (e) return e;
  for(i=0; i<root.document.forms.length; i++) {
    formiterator=root.document.forms[i];
    for (j=0; j<formiterator.elements.length; j++)
      {
        formelement=formiterator.elements[j];
	if (formelement.name == id) return formelement;
      }
  }
  for(i=0; i<root.document.layers.length; i++) {
    layer=root.document.layers[i];
    if(layer.id==id) return layer;
    found=xLayer(id,layer);
    if(found) return found;
  }
  return null;
}
function xLayerFromPoint(x,y,root) { // only for nn4
  var i, hn=null, hz=-1, cn;
  if (!root) root = window;
  for (i=0; i < root.document.layers.length; ++i) {
    cn = root.document.layers[i];
    if (cn.visibility != "hide" && x >= cn.pageX && x <= cn.pageX + cn.clip.right && y >= cn.pageY && y <= cn.pageY + cn.clip.bottom ) {
      if (cn.zIndex > hz) { hz = cn.zIndex; hn = cn; }
    }
  }
  if (hn) {
    cn = xLayerFromPoint(x,y,hn);
    if (cn) hn = cn;
  }
  return hn;
}
function xParent(e){
  if (!(e=xGetElementById(e))) return null;
  var p=null;
  if (e.parentLayer){if (e.parentLayer!=window) p=e.parentLayer;}
  else{
    if (e.offsetParent) p=e.offsetParent;
    else if (e.parentNode) p=e.parentNode;
    else if (e.parentElement) p=e.parentElement;
  }
  return p;
}
function xDef() {
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=="" || typeof(arguments[i])=="undefined") return false;}
  return true;
}

// Window:
function xScrollLeft() {
  var offset=0;
  if(xDef(window.pageXOffset)) offset=window.pageXOffset;
  else if(document.documentElement && document.documentElement.scrollLeft) offset=document.documentElement.scrollLeft;
  else if(document.body && xDef(document.body.scrollLeft)) offset=document.body.scrollLeft;
  return offset;
}
function xScrollTop() {
  var offset=0;
  if(xDef(window.pageYOffset)) offset=window.pageYOffset;
  else if(document.documentElement && document.documentElement.scrollTop) offset=document.documentElement.scrollTop;
  else if(document.body && xDef(document.body.scrollTop)) offset=document.body.scrollTop;
  return offset;
}
function xClientWidth() {
  var w=0;
  if(xOp5or6) w=window.innerWidth;
  else if(xIE4Up && document.documentElement && document.documentElement.clientWidth)
    w=document.documentElement.clientWidth;
  else if(document.body && document.body.clientWidth)
    w=document.body.clientWidth;
  else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
    w=window.innerWidth;
    if(document.height>window.innerHeight) w-=16;
  }
  return w;
}
function xClientHeight() {
  var h=0;
  if(xOp5or6) h=window.innerHeight;
  else if(xIE4Up && document.documentElement && document.documentElement.clientHeight)
    h=document.documentElement.clientHeight;
  else if(document.body && document.body.clientHeight)
    h=document.body.clientHeight;
  else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
    h=window.innerHeight;
    if(document.width>window.innerWidth) h-=16;
  }
  return h;
}
// end x.js

// begin m-x.js extension by Martin Krolik
function xClipValues(e,which) {
        if(!(e=xGetElementById(e))) return;
        var clipv;
        if (e.style) {
          if (e.style.clip == "") return Number.NaN;
          clipv = e.style.clip.split("rect(")[1].split(")")[0].split("px");
        }
        which=which.toLowerCase()
        if (which=="t") return (e.clip)? e.clip.top : Number(clipv[0]);
        if (which=="r") return (e.clip)? e.clip.right : Number(clipv[1]);
        if (which=="b") return (e.clip)? e.clip.bottom : Number(clipv[2]);
        if (which=="l") return (e.clip)? e.clip.left : Number(clipv[3]);
}
function xDisolveTo(e,t,r,b,l,uTime) {
  if (!(e=xGetElementById(e))) return;
  if (!e.timeout) e.timeout = 25;
  e.tTarget = t; e.rTarget = r; e.bTarget = b; e.lTarget = l; e.desolveTime = uTime; e.stop = false;
  e.tA = e.tTarget - xClipValues(e,"t"); e.rA = e.rTarget - xClipValues(e,"r"); e.bA = e.bTarget - xClipValues(e,"b"); e.lA = e.lTarget - xClipValues(e,"l");// A = distance
  e.B = Math.PI / (2 * e.desolveTime); // B = period
  e.tD = xClipValues(e,"t"); e.rD = xClipValues(e,"r"); e.bD = xClipValues(e,"b"); e.lD = xClipValues(e,"l");// D = initial position
  var d = new Date(); e.C = d.getTime();
  if (!e.desolving) xDisolve(e);
}
function xDisolve(e) {
  if (!(e=xGetElementById(e))) return;
  var now, s, t, newY, newX;
  now = new Date();
  t = now.getTime() - e.C;
  if (e.stop) { e.desolving = false; }
  else if (t < e.desolveTime) {
    setTimeout("xDisolve('"+e.id+"')", e.timeout);
    s = Math.sin(e.B * t);
    newT = Math.round(e.tA * s + e.tD);
    newR = Math.round(e.rA * s + e.rD);
    newB = Math.round(e.bA * s + e.bD);
    newL = Math.round(e.lA * s + e.lD);
    xClip(e, newT, newR, newB, newL);
    e.desolving = true;
  }  
  else {
    xClip(e, e.tTarget, e.rTarget, e.bTarget, e.lTarget);
    e.desolving = false;
  }  
}
function xAppearFrom(e,dir,uTime) {
  if (!(e=xGetElementById(e))) return;
  if (!e.timeout) e.timeout = 25;
  dir=dir.toLowerCase();
  e.direction=dir;
  e.xTarget = xPageX(e); e.yTarget = xPageY(e);
  e.wTarget = xWidth(e); e.hTarget = xHeight(e);
  e.desolveTime = uTime; e.stop = false;
  e.tTarget = xClipValues(e,"t"); e.rTarget = xClipValues(e,"r"); e.bTarget = xClipValues(e,"b"); e.lTarget = xClipValues(e,"l");
  if (dir=="nw") {
    xMoveTo(e,(e.xTarget - e.wTarget), (e.yTarget - e.hTarget));
    xClip(e, e.bTarget, e.rTarget, e.bTarget, e.rTarget);
  }
  else if (dir=="n") {
    xMoveTo(e,e.xTarget, (e.yTarget - e.hTarget));
    xClip(e, e.bTarget, e.rTarget, e.bTarget, e.lTarget);
  }
  else if (dir=="ne") {
    xMoveTo(e,(e.xTarget + e.wTarget), (e.yTarget - e.hTarget));
    xClip(e, e.bTarget, e.lTarget, e.bTarget, e.lTarget);
  }
  else if (dir=="e") {
    xMoveTo(e,(e.xTarget + e.wTarget), e.yTarget);
    xClip(e, e.tTarget, e.lTarget, e.bTarget, e.lTarget);
  }
  else if (dir=="w") {
    xMoveTo(e,(e.xTarget - e.wTarget), e.yTarget);
    xClip(e, e.tTarget, e.rTarget, e.bTarget, e.rTarget);
  }
  else if (dir=="se") {
    xMoveTo(e,(e.xTarget - e.wTarget), (e.yTarget + e.hTarget));
    xClip(e, e.tTarget, e.rTarget, e.tTarget, e.rTarget);
  }
  else if (dir=="s") {
    xMoveTo(e,e.xTarget, (e.yTarget + e.hTarget));
    xClip(e, e.tTarget, e.rTarget, e.tTarget, e.lTarget);
  }
  else if (dir=="sw") {
    xMoveTo(e,(e.xTarget + e.wTarget), (e.yTarget + e.hTarget));
    xClip(e, e.tTarget, e.lTarget, e.tTarget, e.lTarget);
  }
  e.xD = xPageX(e); e.yD = xPageY(e)
  e.tD = xClipValues(e,"t"); e.rD = xClipValues(e,"r"); e.bD = xClipValues(e,"b"); e.lD = xClipValues(e,"l");// D = initial position
  e.xA = e.xTarget - e.xD;   e.yA = e.yTarget - e.yD;
  e.tA = e.tTarget - e.tD; e.rA = e.rTarget - e.rD; e.bA = e.bTarget - e.bD; e.lA = e.lTarget - e.lD;// A = distance
  e.B = Math.PI / (2 * e.desolveTime); // B = period
  var d = new Date(); e.C = d.getTime();
  xShow(e);
  if (!e.appearing) xAppear(e);
}
function xAppear(e) {
  if (!(e=xGetElementById(e))) return;
  var now, s, t, newY, newX;
  now = new Date();
  t = now.getTime() - e.C;
  if (e.stop) { e.appearing = false; }
  else if (t < e.desolveTime) {
    setTimeout("xAppear('"+e.id+"')", e.timeout);
    s = Math.sin(e.B * t);
    newX = Math.round(e.xA * s + e.xD);
    newY = Math.round(e.yA * s + e.yD);
    newT = Math.round(e.tA * s + e.tD);
    newR = Math.round(e.rA * s + e.rD);
    newB = Math.round(e.bA * s + e.bD);
    newL = Math.round(e.lA * s + e.lD);
    xMoveTo(e, newX, newY);
    xClip(e, newT, newR, newB, newL);
    e.appearing = true;
  }  
  else {
    xMoveTo(e, e.xTarget, e.yTarget);
    xClip(e, e.tTarget, e.rTarget, e.bTarget, e.lTarget);
    if(e.disappear) {
      xHide(e);
      xMoveTo(e, e.xD, e.yD);
      xClip(e, e.tD, e.rD, e.bD, e.lD);
      e.disappear=false;
    }
    e.appearing = false;
  }  
}
function xDisappearTo(e,dir,uTime) {
  if (!(e=xGetElementById(e))) return;
  if (!e.timeout) e.timeout = 25;
  e.disappear=true;
  dir=dir.toLowerCase();
  e.direction=dir;
  e.tD = xClipValues(e,"t"); e.rD = xClipValues(e,"r"); e.bD = xClipValues(e,"b"); e.lD = xClipValues(e,"l");// D = initial position
  e.xD = xPageX(e); e.yD = xPageY(e)
  e.wD = e.rD - e.lD; e.hD = e.bD - e.tD;
  e.desolveTime = uTime; e.stop = false;
  if (dir=="nw") {
    e.xTarget=(e.xD-e.wD); e.yTarget=(e.yD-e.hD);
    e.tTarget=(e.tD+e.hD); e.rTarget=e.rD; e.bTarget=e.bD; e.lTarget=(e.lD+e.wD);
  }
  else if (dir=="n") {
    e.xTarget=e.xD; e.yTarget=(e.yD-e.hD);
    e.tTarget=(e.tD+e.hD); e.rTarget=e.rD; e.bTarget=e.bD; e.lTarget=e.lD;
  }
  else if (dir=="ne") {
    e.xTarget=(e.xD+e.wD); e.yTarget=(e.yD-e.hD);
    e.tTarget=(e.tD+e.hD); e.rTarget=(e.rD-e.wD); e.bTarget=e.bD; e.lTarget=(e.lD-e.wD);
  }
  else if (dir=="w") {
    e.xTarget=(e.xD-e.wD); e.yTarget=e.yD;
    e.tTarget=e.tD; e.rTarget=e.rD; e.bTarget=e.bD; e.lTarget=(e.lD+e.wD);
  }
  else if (dir=="e") {
    e.xTarget=(e.xD+e.wD); e.yTarget=e.yD;
    e.tTarget=e.tD; e.rTarget=(e.rD-e.wD); e.bTarget=e.bD; e.lTarget=(e.lD-e.wD);
  }
  else if (dir=="se") {
    e.xTarget=(e.xD-e.wD); e.yTarget=(e.yD+e.hD);
    e.tTarget=e.tD; e.rTarget=e.rD; e.bTarget=(e.bD-e.hD); e.lTarget=(e.lD+e.wD);
  }
  else if (dir=="s") {
    e.xTarget=e.xD; e.yTarget=(e.yD+e.hD);
    e.tTarget=e.tD; e.rTarget=e.rD; e.bTarget=(e.bD-e.hD); e.lTarget=e.lD;
  }
  else if (dir=="sw") {
    e.xTarget=(e.xD+e.wD); e.yTarget=(e.yD+e.hD);
    e.tTarget=e.tD; e.rTarget=(e.rD-e.wD); e.bTarget=(e.bD-e.hD); e.lTarget=(e.lD-e.wD);
  }  
  e.xA = e.xTarget - e.xD;   e.yA = e.yTarget - e.yD;
  e.tA = e.tTarget - e.tD; e.rA = e.rTarget - e.rD; e.bA = e.bTarget - e.bD; e.lA = e.lTarget - e.lD;// A = distance
  e.B = Math.PI / (2 * e.desolveTime); // B = period
  var d = new Date(); e.C = d.getTime();
  xShow(e);
  if (!e.appearing) xAppear(e);
}
// end m-x.js extension

var vstate = false;
var startx = 0;
var starty = 0;
function mdevent(objEvent)
{
  if (vstate == false) 
  {
    var oEvent = new xEvent(objEvent);
    quitmoving();
    xdist = 0;
    ydist = 0;
    startx = oEvent.pageX;
    starty = oEvent.pageY;
    vstate = true;
  }
}
function mmevent(objEvent)
{
  if (vstate) {
    var oEvent = new xEvent(objEvent);
    var xdelta, ydelta;
    xdelta = oEvent.pageX - startx;
    ydelta = oEvent.pageY - starty;
    if (xdelta > 0)
      {
      xdist = Math.round(Math.min(( xdelta / 2) , maxtravel));
      }
    else
      {
      xdist = Math.round(Math.max(( xdelta / 2) , 0-maxtravel));
      }
    if (ydelta > 0)
      {
      ydist = Math.round(Math.min(( ydelta / 2) , maxtravel));
      }
    else
      {
      ydist = Math.round(Math.max(( ydelta / 2) , 0-maxtravel));
      }
    /*
    // begin experimental mouse moving 2
    if (oEvent.pageX > startx)  { 
      xdist = defaulttravel;
    } else if (oEvent.pageX < startx)  { 
      xdist = 0 - defaulttravel;
    } else {  
      xdist = 0;
    }
    
    if (oEvent.pageY > starty)  { 
      ydist = defaulttravel;
    } else if (oEvent.pageY < starty) { 
      ydist = 0 - defaulttravel;
    } else {
      ydist = 0;
    }
            end experimental mouse moving 2 */
    shiftover(); 
  }
}
function muevent(objEvent)
{
  if (vstate) 
  {
    var oEvent = new xEvent(objEvent);
    // begin experimental mouse moving 3
    //xdist = Math.round(Math.min(( (oEvent.pageX - startx) / 2) , 50));
    //ydist = Math.round(Math.min(( (oEvent.pageY - starty) / 2) , 50));
    //shiftover(); 
    // end experimental mouse moving 3
    vstate = false;
  }
}
function zoomReset()
{
    if (!loaded) return;
    if (document.layers)
    {
      alert('The Zoom feature is not supported in Netscape 4.');
      return;
    }
    var nheight = origimageheight;
    var nwidth = origimagewidth;
    var left = xLeft(myobject);
    var top = xTop(myobject);
    var nl = left;
    var nt = top;
    if (nt < 0 - nheight + yviewport)
    {
      nt = 0 - nheight + yviewport ;
    }
    if (nt > 0)
    {
      nt = 0;
    }
    if (nl > 0)
    {
      nl = 0;
    }

    xWidth(myimage, origimagewidth);
    xHeight(myimage, origimageheight);	
 
    xWidth(mysecondimage, origimagewidth);
    xHeight(mysecondimage, origimageheight);

    xLeft(myobject, nl);
    xTop(myobject, nt);
    shiftover();
}
function zoomIn()
{
    if (!loaded) return;
    if (document.layers)
    {
      alert('The Zoom feature is not supported in Netscape 4.');
      return;
    }
    dblZoom = 1.2; // Zoom Out Percentage
    var nwidth = Math.round(dblZoom * xWidth(myimage)) ;
    var nheight = Math.round(dblZoom * xHeight(myimage)) ;
    xWidth(myimage, nwidth);
    xHeight(myimage, nheight);	
 
    xWidth(mysecondimage, nwidth );
    xHeight(mysecondimage, nheight );

    var left = xLeft(myobject);
    var top = xTop(myobject);
    var nl = dblZoom * (left - (0.5 * xviewport)) + (0.5 * xviewport) ;
    var nt = dblZoom * (top - (0.5 * yviewport)) + (0.5 * yviewport) ;
    xLeft(myobject, nl);
    xTop(myobject, nt);
    if (document.layers)
    {
      xClip(myobject,null, xviewport - xLeft(myobject) ,null,null);
    }
    shiftover();
    return;
}
function zoomOut()
{
    if (!loaded) return;
    if (document.layers)
    {
      alert('The Zoom feature is not supported in Netscape 4.');
      return;
    }
    dblZoom = 0.8;  // Zoom Out Percentage
    var nwidth = Math.round(dblZoom * xWidth(myimage)) ;
    var nheight = Math.round(dblZoom * xHeight(myimage)) ;
    if (( xviewport < nwidth ) && ( yviewport < nheight ) )
    {
      var left = xLeft(myobject);
      var top = xTop(myobject);
      var nl = dblZoom * (left - (0.5 * xviewport)) + (0.5 * xviewport) ;
      var nt = dblZoom * (top - (0.5 * yviewport)) + (0.5 * yviewport) ;  
      if (nt < 0 - nheight + yviewport)
      {
        nt = 0 - nheight + yviewport ;
      }
      if (nt > 0)
      {
        nt = 0;
      }
      if (nl > 0)
      {
        nl = 0;
      }


      xWidth(myimage, nwidth);
      xHeight(myimage, nheight);	
 
      xWidth(mysecondimage, nwidth);
      xHeight(mysecondimage, nheight);

      xLeft(myobject, nl);
      xTop(myobject, nt);
      if (document.layers)
      {
        xClip(myobject,null, xviewport - xLeft(myobject) ,null,null);
      }
    }
    shiftover();  
    return;
}
function initpiv() 
{
  myobject = xGetElementById("dimg");
  outerimgdiv = xGetElementById("dimgOuter");
  mypframe = xGetElementById("mypicframe");
  myloadingdiv = xGetElementById("nowloading");
  myimage = xGetElementById("ione");
 
  mysecondimage = xGetElementById("itwo");
 
 
  imgNW = xGetElementById("borderNW");
  imgN = xGetElementById("borderN");
  imgNE = xGetElementById("borderNE");
  imgW = xGetElementById("borderW");
  imgE = xGetElementById("borderE");
  imgSW = xGetElementById("borderSW");
  imgS = xGetElementById("borderS");
  imgSE = xGetElementById("borderSE");
 
  
   
  if (document.layers)
  {
    xAddEventListener(document, "mousedown", mdevent, true);
    xAddEventListener(document, "mousemove", mmevent, true);
    xAddEventListener(document, "mouseup", muevent, true); 
  } else {
  if (mypframe)
  {
    xAddEventListener(mypframe, "mousedown", mdevent, true);
    xAddEventListener(mypframe, "mousemove", mmevent, true);
    xAddEventListener(mypframe, "mouseup", muevent, true);
  }
  if (outerimgdiv)
  {
    xAddEventListener(outerimgdiv, "mousedown", mdevent, true);
    xAddEventListener(outerimgdiv, "mousemove", mmevent, true);
    xAddEventListener(outerimgdiv, "mouseup", muevent, true);
  }
  if (myobject)
  {
    xAddEventListener(myobject, "mousedown", mdevent, true);
    xAddEventListener(myobject, "mousemove", mmevent, true);
    xAddEventListener(myobject, "mouseup", muevent, true);
  }
  if (myimage)
  {
    xAddEventListener(myimage, "mousedown", mdevent, true);
    xAddEventListener(myimage, "mousemove", mmevent, true);
    xAddEventListener(myimage, "mouseup", muevent, true);
  }
  if (mysecondimage)
  {
    xAddEventListener(mysecondimage, "mousedown", mdevent, true);
    xAddEventListener(mysecondimage, "mousemove", mmevent, true);
    xAddEventListener(mysecondimage, "mouseup", muevent, true);
  }
  } // no document.layers
 
  origimagewidth = xWidth(myimage);
  origimageheight = xHeight(myimage); 
  loaded = true;
  positionpiv();
  if (pOldOnLoadPIV != null) {
    pOldOnLoadPIV();
  }	
}
function positionpiv()
{
  xoffset = xPageX('PlaceHolderDiv') + borderwidth;
  yoffset = xPageY('PlaceHolderDiv') + borderheight;
  if (loaded) 
  {
    xMoveTo(outerimgdiv,xoffset,yoffset);
    xMoveTo(mypframe,xoffset-borderwidth,yoffset-borderheight+1);
  }
  xHide(myloadingdiv);
  xClip(myloadingdiv,0,0,0,0);
  xShow(outerimgdiv);
  xShow(myobject);
  xShow(mypframe);
  xClip(mypframe,0,(xviewport+borderwidth+borderwidth),(yviewport+borderheight+borderheight),0);
  xClip(mypframe,0,(xviewport+borderwidth+borderwidth),(yviewport+borderheight+borderheight),0);
		
  // lines below seem to add wierd blank pixel lines to top and bottom
  // of scroll in ie5
  xdist = xoffsetwithinpic;
  ydist = yoffsetwithinpic;

  shiftover();
  quitmoving();
  xdist=1;
  ydist=0;
  shiftover();  
  if (pOldOnResizePIV != null) {
    pOldOnResizePIV();
  }	

}	
function shiftover()
{
 if (loaded) 
 {
  quitmoving();
  if ( ((xTop(myobject) - ydist ) >= 0) && (ydist<0) ) 
  {
    ydist = 0; 
  } else
  if ( ((xTop(myobject) - ydist ) <= ( yviewport - xHeight(myimage) ) ) && (ydist>0) ) 
  {
    ydist = 0; 
  }

  xMoveTo(myobject, xLeft(myobject) - xdist, xTop(myobject) - ydist);
 
  if (xLeft(myobject) > 0 )
  {
    xLeft(myobject, 0 - xWidth(myimage));
  } else 
  if (xLeft(myobject) < (0 - xWidth(myimage) ) ) 
  {
    xLeft(myobject, 0);
  } 

  if (document.layers)
  {
  	xClip(myobject,null, xviewport - xLeft(myobject) ,null,null);
  }
  initialized == true;
  if ((xdist != 0) || (ydist != 0))
  {
    mytimer = setTimeout("shiftover()",defaulttimeout);
  }
 }
}
function quitmoving() 
{
  if (mytimer)
  {
    clearTimeout(mytimer);
  }
  if (quitmoving.arguments.length > 0)
  {
    var blnClearDist = quitmoving.arguments[0];
    if (blnClearDist == true)
    {
      xdist = 0;
      ydist = 0;
    }
  }
}
function SwapImage(vImageName, vImageSrc)
{
  var objImg = xGetElementById(vImageName);
  if (objImg)
  {
    if (objImg.src)
    {
      objImg.src = vImageSrc;
    }
  }
}
function move_NW() {
  xdist=-defaulttravel;
  ydist=-defaulttravel;
  shiftover();
}
function move_N() {
  xdist=0;
  ydist=-defaulttravel;
  shiftover();
}
function move_NE() {
  xdist=defaulttravel;
  ydist=-defaulttravel;
  shiftover();
}
function move_W() {
  xdist=-defaulttravel;
  ydist=0;
  shiftover();
}
function move_E() {
  xdist=defaulttravel;
  ydist=0;
  shiftover();
}
function move_SW() {
  xdist=-defaulttravel;
  ydist=defaulttravel;
  shiftover();
}
function move_S() {
  xdist=0;
  ydist=defaulttravel;
  shiftover();
}
function move_SE() {
  xdist=defaulttravel;
  ydist=defaulttravel;
  shiftover();
}

xMoveTo(myloadingdiv, xLeft('PlaceHolderDiv'), xTop('PlaceHolderDiv'));

window.onload=initpiv;
window.onresize=positionpiv;


</SCRIPT>
<STYLE type="text/css">
.placeHolder {
	POSITION: relative;
	WIDTH: 330px; 
	HEIGHT: 210px; 
	VISIBILITY: visible; 
	CURSOR: move;
	z-index: 10; 
}
.nowLoading {
	VISIBILITY: visible; 
	POSITION: absolute;
}
.imageDiv {
	POSITION: relative; 
	TOP: 0px;
	LEFT: 0px; 
	CURSOR: move;
	z-index: 30; 
}
.imageDivOuter {
	VISIBILITY: hidden; 
	POSITION: absolute; 
	TOP: 0px;
	LEFT: 0px; 
	CURSOR: move;
	WIDTH: 280px; 
	HEIGHT: 160px; 
	OVERFLOW: hidden;
	z-index: 30; 
}
.picFrameDiv {
	POSITION: absolute; 
	CLIP: rect(0px 0px 0px 0px); 
	TOP: 10px; 
	LEFT: 10px; 
	z-index: 50; 	
	CURSOR: move;
}
</STYLE>

<!--div containing a couple images begin-->
<DIV id="dimgOuter" class="imageDivOuter" name="dimgOuter">
<DIV id="dimg" class="imageDiv" name="dimg">
  <script>
    document.write ('<TD><IMG id="ione" name="ione" src="http://sites.google.com/site/macuartero/panorama.jpg" border="0"></TD>');
    document.write ('<TD><IMG id="itwo" name="itwo" src="http://sites.google.com/site/macuartero/panorama.jpg" border="0"></TD>');
  </script>    
</DIV>
<!--div containing a couple images end-->
<!--div containing the picture frame -->
 
</DIV>
<DIV id="mypicframe" class="picFrameDiv">
 
</DIV>
<!--div containing the picture frame -->
<!-- now loading div begin -->
<DIV id='nowloading' class='nowLoading'>
<H5> Please wait.  Loading.... </H5>         
</DIV>

<!-- now loading div end-->
<table border='0' cellPadding='0' cellSpacing='0'><tr><td colspan='3'>
<!-- Before Placeholder --></td></tr><tr><td>
<!-- Left of Placeholder -->
</td><td>
<!-- important placeholder div begin 

******    THIS IS THE DIV THAT IS USED TO PLACE THE PIV IN YOUR OWN CUSTOM PAGE LAYOUT  ******
	
-->
<DIV id='PlaceHolderDiv' class='placeHolder'><table border=0 WIDTH=800
HEIGHT=600 >
<tr><td> </td></tr></table>
</DIV>
<!-- important placeholder div end -->
</td><td>
<!-- Right of Placeholder -->
</td></tr>
<!-- After Placeholder -->

</table>

</BODY>
<!-- Script Size:  17.94 KB -->